package com.jushu.storbox;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.Toast;

import com.jushu.storbox.network.WifiController;

public class DialogActivity extends Activity {
	public static DialogActivity dialogActivity = null;
	private Button dialogactivitySite;
	private Button dialogactivityClean;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.dialogactivity);
		dialogActivity = this;
		dialogactivitySite = (Button) findViewById(R.id.dialogactivity_site);
		dialogactivityClean = (Button) findViewById(R.id.dialogactivity_clean);
		dialogactivityClean.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				WifiController wifiController = new WifiController(
						DialogActivity.this);
				int status = wifiController.getNetWord();
				if (status == 0) {
					Toast.makeText(dialogActivity, R.string.network_problem,
							Toast.LENGTH_SHORT).show();
				}
				DialogActivity.this.finish();
			}
		});
		dialogactivitySite.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View arg0) {
				Intent intent = new Intent("android.settings.WIFI_SETTINGS");
				DialogActivity.this.startActivity(intent);
			}
		});
	}
}
